#!/bin/bash


cat all-ee-third-images| while read line;do
    ee1=$(echo $line | cut -d "_" -f 1)
    ee2=$(echo $line | cut -d "_" -f 2)
    ee3=$(echo $line | cut -d "_" -f 3)
    ee1=$(echo $ee1|cut -d '_' -f 1|awk -F '/' '{print $NF}')
    docker pull $line
    if [ -z "$ee3" ];then
       echo "docker tag $line $ee1/$ee2"
       docker tag $line $ee1/$ee2
    else
       echo "tag $line $ee1/$ee2/$ee3"
       docker tag $line $ee1/$ee2/$ee3
    fi
done